﻿using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;

namespace SZ.Mech
{
    /// <summary>
    /// 这个废弃了，因为原话说的是跟DLC一样就可
    /// </summary>
    public class CompProperties_SZProjectileInterceptor : CompProperties_ProjectileInterceptor
    {
        /// <summary>
        /// 图形设置尝试
        /// </summary>
        public GraphicData interceptorGraphicData;

        public CompProperties_SZProjectileInterceptor()
        {
            compClass = typeof(CompSZProjectileInterceptor);
        }
    }
    [StaticConstructorOnStartup]
    public class CompSZProjectileInterceptor : CompProjectileInterceptor
    {
        public CompProperties_SZProjectileInterceptor Properties
        {
            get
            {
                return (CompProperties_SZProjectileInterceptor)props;
            }
        }

        //private static readonly Material ForceFieldMat = MaterialPool.MatFrom("Other/ForceField", ShaderDatabase.MoteGlow);
        //private static readonly Material ForceFieldConeMat = MaterialPool.MatFrom("Other/ForceFieldCone", ShaderDatabase.MoteGlow);
        
        public override void PostDraw()
        {
            base.PostDraw();
            Vector3 drawPos = parent.DrawPos;
            drawPos.y = AltitudeLayer.MoteOverhead.AltitudeFor();

            Matrix4x4 matrix = default(Matrix4x4);
            matrix.SetTRS(drawPos, Quaternion.identity, new Vector3(Props.radius * 2f * 1.16015625f, 1f, Props.radius * 2f * 1.16015625f));

            Properties.interceptorGraphicData.Graphic.Draw(drawPos,Rot4.North, this.parent);


            //Graphics.DrawMesh(MeshPool.plane10, matrix, ForceFieldMat, 0, null, 0, MatPropertyBlock);
        }
    }
}
